<?php
/***************************************************************************
 *                           display_debug_info.php
 *                            -------------------
 *                       (APU) Automated Pilot Utility
 *   begin                : Friday, Dec 24, 2005
 *   copyright            : (C) 2004 SF Games
 *   email                : techsupport@sf-games.com
 *
 ***************************************************************************/

	$apus_root_path = '../include/';
	include($apus_root_path . 'common.php');
	include($apus_root_path . 'config.php');

	echo("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
	echo("<html>\n");
	echo("<head>\n");
	echo("<title>APU - Admin Main</title>\n");
	echo("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n");
	echo("</head>\n");
	echo("<body bgcolor=\"#FFFFFF\" text=\"#000000\">\n");
	echo("<div align=\"center\">\n");
		echo("<p><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"4\" color=\"#840000\"><b><font size=\"5\">APU - Automated Pilot Utility</font></b></font><br>\n");
		echo("<b><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"4\" color=\"#840000\">Debug Information</font></b></p>\n");

		//
		// Our intro verbiage
		//

		echo("<table width=\"416\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" height=\"97\">\n");
			echo("<tr>\n");
				echo("<td width=\"416\" height=\"28\" valign=\"top\">\n");
				echo("<div align=\"center\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"5\" color=\"#840000\">");
				echo("<b><font size=\"2\">");
					echo("This displays useful debug information for the hosting server,<br>");
					echo("PHP information and MySQL information.<br>");
					echo("Additional APU specific information may also be displayed<br>");
				echo("</font></b></font>");
				echo("</div>\n");
				echo("</td>\n");
			echo("</tr>\n");
		echo("</table>\n");
		echo("<br>\n");

		//
		// APU Information
		//

		echo("<table width=\"416\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" height=\"97\">\n");
			echo("<tr>\n");
				echo("<td width=\"416\" height=\"28\" valign=\"top\">\n");
				echo("<div align=\"left\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"5\" color=\"#840000\">");
				echo("<b><font size=\"2\">");
					echo("APU Version: " .$APU_VERSION .",<br>");
					echo("Current Server Date: " .getTodayAsUSDate() ."<br>");
					echo("Current Server Time: " .getCurrentTime() ."<br>");

					if ( $bSendPirepEmailToAdmin )
						echo("Mail to Admin: true<br>");
					else
						echo("Mail to Admin: false<br>");

					if ( $bSendPirepEmailToQa )
						echo("Mail to QA: true<br>");
					else
						echo("Mail to QA: false<br>");

					if ( $bSendPirepEmailToPilot )
						echo("Mail to Pilot: true<br>");
					else
						echo("Mail to Pilot: false<br>");

					echo("PHP Version: " .phpversion() .",<br>");
					// Have to usally connect to get this
					$db = mysql_connect($dbhost, $dbuname, $dbpass)
						or die("Could not connect to the SQL server<br>");
					echo("MySQL Version: " .mysql_get_server_info().",<br>");

				echo("</font></b></font>");
				echo("</div>\n");
				echo("</td>\n");
			echo("</tr>\n");
		echo("</table>\n");
		echo("<br>\n");

		//
		// MySQL Information
		//

		//
		// PHP Information
		//

		phpinfo();

		//
		// Copyright
		//

		echo("<p><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\" color=\"#999999\">" .$APU_COPYRIGHT ."</font></p>\n");
	echo("</div>\n");
	echo("</body>\n");
	echo("</html>\n");
?>
